/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author salm
 */
public class DefaultPort
{
    private int DALPort, BLLPort, PREPort;
    
    private DefaultPort()
    {
        // NEED TABLE
        try
        {
            Properties p = new Properties();
            p.load(new FileInputStream("src\\PortConfig.ini"));
            
            DALPort = Integer.parseInt(p.getProperty("DAL"));
            BLLPort = Integer.parseInt(p.getProperty("BLL"));
            PREPort = Integer.parseInt(p.getProperty("PRE"));
        }
        catch (IOException ioEx)
        {
            DALPort = 2013;
            BLLPort = 2014;
            PREPort = 2015;
        }
    }
    
    public static DefaultPort getInstance() {
        return inst;
    }
    private static DefaultPort inst = new DefaultPort();

    /**
     * @return the DALPort
     */
    public int getDALPort() {
        return DALPort;
    }

    /**
     * @return the BLLPort
     */
    public int getBLLPort() {
        return BLLPort;
    }

    /**
     * @return the PREPort
     */
    public int getPREPort() {
        return PREPort;
    }

    /**
     * @param DALPort the DALPort to set
     */
    public void setDALPort(int DALPort) {
        this.DALPort = DALPort;
    }

    /**
     * @param BLLPort the BLLPort to set
     */
    public void setBLLPort(int BLLPort) {
        this.BLLPort = BLLPort;
    }

    /**
     * @param PREPort the PREPort to set
     */
    public void setPREPort(int PREPort) {
        this.PREPort = PREPort;
    }
    
    
}
